From 3a3b9632b13fadc5def70dc4c04711777c15c695 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 25 May 1993 23:19:45 +0000 Subject: [PATCH] (swallow_events): New function. --- src/keyboard.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index 9ca8d39d631..8b307c7fa6d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1967,6 +1967,52 @@ kbd_buffer_get_event () return (obj); } +/* Process any events that are not user-visible. */ + +void +swallow_events () +{ + while (kbd_fetch_ptr != kbd_store_ptr) + { + struct input_event *event; + + event = ((kbd_fetch_ptr < kbd_buffer + KBD_BUFFER_SIZE) + ? kbd_fetch_ptr + : kbd_buffer); + + last_event_timestamp = event->timestamp; + + /* These two kinds of events get special handling + and don't actually appear to the command loop. */ + if (event->kind == selection_request_event) + { +#ifdef HAVE_X11 + x_handle_selection_request (event); + kbd_fetch_ptr = event + 1; +#else + /* We're getting selection request events, but we don't have + a window system. */ + abort (); +#endif + } + + else if (event->kind == selection_clear_event) + { +#ifdef HAVE_X11 + x_handle_selection_clear (event); + kbd_fetch_ptr = event + 1; +#else + /* We're getting selection request events, but we don't have + a window system. */ + abort (); +#endif + } + else + break; + } + + get_input_pending (&input_pending); +} /* Caches for modify_event_symbol. */ static Lisp_Object func_key_syms; -- 2.30.2